local f = 
-- 暗影牢笼持续时间文字
function(allstates, event, _, subEvent, _, _, sourceName, _, _, _, _, _, _, spellID, spellName)
    local dump = function(...)
        if aura_env.config.debug == true then
            print(...)    
        end
    end

    local msg = ''
    local mySpellID = 30168
    if aura_env.config.debug then mySpellID = aura_env.config.cage_spell_id end
    local spellAuraApplied = subEvent == "SPELL_AURA_APPLIED"
    local spellAuraRemoved = subEvent == "SPELL_AURA_REMOVED"

    if spellAuraApplied and spellID == mySpellID then
        local now = GetTime()
        local newCage = {start = now, end = 0, duration = 0}
        if not aura_env.shadow_cage then
            aura_env.shadow_cage = {}
        end
        table.insert(aura_env.shadow_cage, newCage)
        dump('shadow cage start at ' .. newCage.start)
    end

    if spellAuraRemoved and spellID == mySpellID t then
        for kk, vv in pairs(aura_env.shadow_cage) do
            if k == #aura_env.shadow_cage then
                v.end = GetTime()
                v.duration = math.modf(v.end - v.start)
            end
        end
        dump('cage duration is: ' .. aura_env.shadow_cage[#aura_env.shadow_cage].duration)
        return true
     end

    return false
end